<div class="layui-fluid" id="VIEW-list-table" lay-title="sku选择列表" lig-title="sku-choose-title">
    <form class="layui-form" lay-filter="lig-user-searchform" style="margin-top:10px;">
        <div class="layui-form-item">
            <div class="layui-inline">
                <label class="layui-form-label" lig-lang="sku-spmc">用户名</label>
                <div class="layui-input-inline">
                    <input type="text" class="layui-input" name="userName" />
                </div>
            </div>
            <div class="layui-inline">
                <div class="layui-input-inline">
                    <div class="layui-btn layui-btn-sm" lay-filter="lig-user-search" lig-lang="btn-search">查询</div>
                </div>
            </div>
        </div>
    </form>
    <div class="layui-row">
        <table lay-filter="lig-choose-sales-table"></table>
    </div>
    <div class="layui-row">
        <div class="ligui-layer-btn" style="text-align:right;pointer-events:auto;">
            <a class="ligui-layer-btn0 ligui-choose" lay-filter="lig-ok">确 定</a>
            <a class="ligui-layer-btn1 ligui-cancel" lay-filter="lig-cancel">取 消</a>
        </div>
    </div>
</div>
<script>
    layui.use(['admin', 'table', 'form', 'layer', 'jquery', 'lig'], function (admin, table, form, layer, $, lig) {
        form.render();

        lig.table({
            elem: '[lay-filter="lig-choose-sales-table"]',
            height: '300px',
            url: 'uc/user/page',
            cols: [[
                { title: '', type: 'radio', fixed: true, width: 60 },
                {title: '<span lig-lang="user-account">账号</span>', field: 'account', align: 'center', minWidth: 120},
                {title: '<span lig-lang="user-userName">用户名</span>', field: 'userName', align: 'center', minWidth: 120}
            ]]
        }, {
            mode: 'dialog',
            entity: 'user',
            primaryField: 'userId'
        });

        $('[lay-filter="lig-ok"]').click(function () {
            var datas = table.checkStatus('userId').data;
            if (datas.length <= 0) {
                return;
            }
            parent.choose_user = datas[0];
            layer.close(layer.index);
        });
        $('[lay-filter="lig-cancel"]').click(function () {
            layer.close(layer.index);
        });
    })
</script>